<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Vuex</title>
    <script src="../../static/vue.js"></script>
    <script src="../../static/vuex.js"></script>
    <script src="./initStore.js"></script>
</head>

<body>
    <div id="app">
        同步版本：
        <button @click="onClick">添加todos</button>
        <ul>
            <li>
                <div v-for="item in todos" :key="item.id">
                    {{ item }}
                </div>
            </li>
        </ul>
    </div>
    <div id="app2">
        异步版本：
        <button @click="onClick">重新获取</button>
        <button @click="onShow">显示隐藏</button>
        <ul v-show="isShow">
            <li>
                <div v-for="item in todos" :key="item.id">
                    {{ item }}
                </div>
            </li>
        </ul>
    </div>
</body>
<script src="./Store.js"></script>

</html>